1. Field of the Invention
The present invention relates to an image encoding technique.
2. Description of the Related Art
Still image data in various formats circulate today. A representative format is the JPEG compression format. Images of the JPEG compression format are also used as output files of digital cameras. There exist various kinds of software, including web browsers, capable of handling JPEG-compressed images. A JPEG-compressed still image has 8 bits per component. For this reason, only 256 tones can be reproduced per component.
On the other hand, human vision can recognize a contrast ratio up to 1:10,000. Hence, there is a large difference between an actual appearance and the tone expression of conventional JPEG images. Under these circumstances, an HDR (High Dynamic Range) image having data of about 32 bits per component has received attention.
Literature: Japanese Paten-Laid Open No. 2007-534238 discloses a technique that makes it possible to view an HDR image having data of 32 bits per component using a conventional JPEG viewer. According to this literature, an HDR image is tone-mapped to an LDR (Low Dynamic Range) image of 8 [bits/component] and JPEG-compressed. The ratio of the HDR image that is the original image to the LDR image is separately created as HDR information, and the HDR information and the JPEG-encoded data of the LDR image are stored in one file. The storage location of the HDR information is within a JPEG application marker (APP marker) (see FIG. 1A). A general JPEG viewer decodes an image without regard for an unsupported APP marker. For this reason, for example, if a JPEG viewer incapable of recognizing APP11 as a marker storing HDR information receives data shown in FIG. 1A, only an LDR image 102 is decoded and displayed. On the other hand, an HDR image viewer capable of recognizing that APP11 stores HDR information can decode and display the original HDR image by combining the LDR image 102 and information 101 in the APP marker.
Assume a case where a JPEG viewer has an image editing function. There are a lot of pieces of software for directly storing meta-data unrecognizable by the viewer itself when storing an edited image. Directly storing meta-data enables keeping compatibility with the device that has created the image.
For example, assume a case where a JPEG viewer having an image editing function decodes and edits only an LDR image in a file in which HDR image data has been stored by the method disclosed in the above literature, and encodes and stores the edited image together with HDR information in the unrecognizable APP marker. In this case, a match between the LDR image and the HDR information in the APP marker is lost.
Hash is usable to detect that image data has undergone editing. For example, a surveillance camera or the like uses a hash value by SHA-1 as image alteration detection data.
When decoding an HDR image, the degree of image quality degradation caused by mismatch between HDR information and an LDR image changes depending on the contents of editing to the LDR image.
When editing that results in a size or aspect ratio different from that of the original image, for example, cutout, enlargement, or 90-degree rotation is performed, even overlaying HDR information on the LDR image is difficult. When editing that changes the position of an object in the image, for example, vertical flip or horizontal flip is performed, an unnatural object or pattern such as ghost appears, resulting in a large difference from the original HDR image. When editing that changes the hue of an entire image, for example, converting an LDR image into a monochrome or sepia image is performed, the entire image is unnaturally color-tinted, greatly impairing the worth of an HDR image. Mismatch caused by these editing processes very largely affects decoding of an HDR image, and displaying an HDR image is not so worth.
On the other hand, mismatch caused by editing of a local region of an image concerning, for example, sharpness or shading of an edge portion has an influence to blur the edge portion when decoding an HDR image, though the image quality degradation does not greatly impair the worth of the HDR image. In one of HDR image creation methods, a plurality of images shot while changing brightness in a narrow dynamic range are overlaid, thereby obtaining an HDR image. In this case, since the edges of the plurality of images rarely fit exactly, processing of shading the edge portions is applied in general. That is, even if the edge portions blur due to mismatch between the LDR image and the HDR information, the worth of an HDR image is not largely impaired. Dust removal is also one of editing processes for a local region of an image. Dust removal is image processing of removing a small black point, which is formed when a dust particle sticking to the imaging plane is included in a shot image, by filling it with a peripheral color. In this case as well, when HDR information is overlaid on a point where a dust particle is removed in an LDR image, the dust particle existing in the original HDR image is only faintly recognizable, although color tint remains to some extent. This mismatch does not greatly impair the worth of an HDR image, either.
Mismatch caused by shading processing such as noise removal for an entire image using a filter of a small radius has no influence to largely impair the worth of an HDR image. When HDR information is overlaid on an LDR image after noise removal, the noise that should have been removed is faintly recognizable. However, the noise existing in the original HDR image as well has little influence. Changing only a compression condition, for example, a Q parameter rarely affects decoding of an HDR image.
As described above, the influence varies depending on the contents of editing to the LDR image.